﻿using System;
using System.Collections.Generic;
using Newtonsoft.Json;

namespace ChinaTax.LeQi
{
    public class QueryTaxClassCodeInfoRequest : Request<QueryTaxClassCodeInfoResponse>
    {
        public QueryTaxClassCodeInfoRequest()
        {
            ServiceCode = "CXSSFLBM";
        }

        [JsonProperty("nsrsbh")]
        public string TaxNo { get => LeQiConfig.TaxNo; }

        [JsonProperty("sjc")]
        public string Timestamp { get; set; }
    }

    public class QueryTaxClassCodeInfoResponse : Response
    {
        [JsonProperty("sjc")]
        public string Timestamp { get; set; }

        [JsonProperty("count")]
        public int Count { get; set; }

        [JsonProperty("ssbmList")]
        public List<TaxClassCodeInfo> List { get; set; }
    }

    public class TaxClassCodeInfo
    {
        [JsonProperty("fjbm")]
        public string ParentNo { get; set; }

        [JsonProperty("sphfwssflhbbm")]
        public string No { get; set; }

        [JsonProperty("sphfwmc")]
        public string Name { get; set; }

        [JsonProperty("sphfwfljc")]
        public string ShortName { get; set; }

        [JsonProperty("zzssl")]
        public string TaxRate { get; set; }

        [JsonProperty("qyrq")]
        public string BeginDate { get; set; }

        [JsonProperty("tyrq")]
        public string EndDate { get; set; }

        [JsonProperty("sfhzx")]
        public string IsAggrItem { get; set; }
    }

}
